from random import randint


class Die():
    """练习9.5，掷骰子"""

    def __init__(self, sides=6, times=1):
        self.sides = sides
        self.times = times
        self.result_number = 1

    def roll_die(self):
        while self.times:
            self.result_number = randint(1, self.sides)
            self.times -= 1
            return self.result_number

# 返回骰子的点数
die_6 = Die(6, 10)
print(die_6.roll_die())

die_10 = Die(10, 10)
print(die_10.roll_die())

